<jsp:include page="header.jsp" />
<%
	String username = (String)session.getAttribute("authenticatedUser");
	Integer access = (Integer)session.getAttribute("access");
	if(access != 0)
	{
		response.sendRedirect("login.jsp");
	}
%>

<%=username %> <%=access %>
<h2>Create A User</h2>
<form class="form-horizontal" action="Create.jsp" name="create_user" id="create_user" style = "margin-left:-100px;"
	id="create_contact" method="post">

	<div class="control-group">
		<label class="control-label" for="user_name">User Name</label>
		<div class="controls">
			<input type="text" id="username" name="username"
				placeholder="Username">
		</div>
	</div>

	<div class="control-group">
		<label class="control-label" for="password">Password</label>
		<div class="controls">
			<input type="text" id="password" name="password"
				placeholder="Password">
		</div>
	</div>

	<div class="control-group">
		<label class="control-label" for="password2">Confirm Password</label>
		<div class="controls">
			<input type="text" id="password2" name="password2"
				placeholder="Confirm Password">
		</div>
	</div>

	<div class="control-group">
		<label class="control-label" for="level_of_access">Level Of
			Access</label>
		<div class="controls">
			<select name="level_of_access">
				<option value="0" selected>Administrator</option>
				<option selected value="1">Regular User</option>
			</select>
		</div>
	</div>

	<div class="form-actions"
		style="background-color: #ffffff; border-top: none;">
		<button type="submit" class="btn btn-primary">Create</button>
		<a href="http://www.google.com" class="btn">Cancel</a>
	</div>

</form>

<script type="text/javascript">
   $('#create_user').submit(function(e) {

if($('#username').val() == '' || $('#password').val() == '' || $('#password2').val() == '' )
    {
        alert('Fuck you dickface!!! ');
        return false;
    }
    if($('#password').val() != $('#password2').val())
    {
        alert("Passwords do not match");
        return false;
    }
    else
        return true;
});

    
</script>
<jsp:include page="footer.jsp" />